package com.yonyou.cyxdms.sysAuth.service.dto.notification;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yonyou.cyx.framework.bean.entity.base.BasePO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeDeserializer;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeSerializer;
import com.yonyou.cyxdms.framework.bean.dto.base.DMSBaseDTO;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 通知通告信息包含关联表
 * </p>
 *
 * @author chengliang
 * @since 2019-09-11
 */

public class NotificationSearchDTO extends DMSBaseDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 通告类型 通告类别
     */
    private Integer notificationType;

    /**
     * 通知主题 通告主题
     */
    private String notificationTitle;

    /**
     * 发布开始时间
     */
    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private LocalDateTime publisStarthDate;

    /**
     * 发布开始时间
     */
    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private LocalDateTime publisEndDate;

    /**
     * 发布人
     */
    private Long publishPerson;

    /**
     * 状态（已保存，已发布）
     */
    private Integer status;


    /**
     * 是否删除
     */
    private Boolean isDeleted;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Integer getNotificationType() {
        return notificationType;
    }

    public void setNotificationType(Integer notificationType) {
        this.notificationType = notificationType;
    }

    public String getNotificationTitle() {
        return notificationTitle;
    }

    public void setNotificationTitle(String notificationTitle) {
        this.notificationTitle = notificationTitle;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public LocalDateTime getPublisStarthDate() {
        return publisStarthDate;
    }

    public void setPublisStarthDate(LocalDateTime publisStarthDate) {
        this.publisStarthDate = publisStarthDate;
    }

    public LocalDateTime getPublisEndDate() {
        return publisEndDate;
    }

    public void setPublisEndDate(LocalDateTime publisEndDate) {
        this.publisEndDate = publisEndDate;
    }

    public Boolean getDeleted() {
        return isDeleted;
    }

    public void setDeleted(Boolean deleted) {
        isDeleted = deleted;
    }

    public Long getPublishPerson() {
        return publishPerson;
    }

    public void setPublishPerson(Long publishPerson) {
        this.publishPerson = publishPerson;
    }

    @Override
    public String toString() {
        return "NotificationSearchDTO{" +
                "notificationType=" + notificationType +
                ", notificationTitle='" + notificationTitle + '\'' +
                ", publisStarthDate=" + publisStarthDate +
                ", publisEndDate=" + publisEndDate +
                ", publishPerson=" + publishPerson +
                ", status=" + status +
                ", isDeleted=" + isDeleted +
                '}';
    }

    /**
     * 将DTO 转换为PO
     * //对某个对象属性进行赋值
     * //BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param poClass dto 需要转换的dto
     * @author chengliang
     * @since 2019-09-11
     */
    @Override
    public <T extends BasePO> T transDtoToPo(Class<T> poClass) {
        return super.transDtoToPo(poClass);
    }

    /**
     * 将DTO 转换为PO
     * BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param po 需要转换的对象
     * @author chengliang
     * @since 2019-09-11
     */
    public <T extends BasePO> void transDtoToPo(T po) {
        BeanMapperUtil.copyProperties(this, po, "notificationId");
    }

}
